<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
				var random = parseInt((Math.random() * 100 + 1));
				Math.floor(random);
				console.log(random);
				
				function panduan(){
					var num=document.getElementById("num").value;
					var span=document.getElementById("span");
					
				if(random>num){
					span.innerHTML="小了";
				}else if(random<num){
					span.innerHTML="大了";
				}else{
					span.innerHTML="恭喜你猜对了";
				}
			}
		</script>
	</head>
	<body>
		<table>
			<tr>
				<input type="text" id="num" value=" "/>
				<input type="button" onclick="panduan()" value="猜" />
				<span id="span"></span>
			</tr>
		</table>
	</body>
</html>
